package com.job.yangshida.homework0715;

/**
 * @author 杨士达
 * @version 1.0
 * @since 2022-07-16 13:36:20
 * ba把字符串中的数字提取出来,求和
 */
public class String05 {
    public static void main(String[] args) {
        String str="10aaa20aaaa70a";
        String part="0";
        int sum=0;
        for (int i=0;i<str.length();i++){
            if (Character.isDigit(str.charAt(i))){
                part+=str.charAt(i);
            }else{
                sum+=Integer.parseInt(part);
                part="0";
            }
        }
        sum+=Integer.parseInt(part);
        System.out.println(sum);
        System.out.println(Integer.parseInt("012"));
    }
}
